<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 通过构造函数 属性为 (uname，sex，age) 创建出 你们小组的所有人
      // 用数组统计起来 通过年龄筛选小于20的同学

      function Supman(uname, sex, age) {
        this.uname = uname
        this.sex = sex
        this.age = age
      }
      let aa = new Supman('张三', '男', 18)
      let bb = new Supman('李四', '男', 19)
      let cc = new Supman('王五', '男', 21)
      console.log(aa, bb, cc)

      let arr = [aa, bb, cc]
      let newarr = []
      arr.map(function (item) {
        if (item.age < 20) {
          newarr.push(item.age)
        }
      })
      console.log(newarr)
    </script>
  </body>
</html>
